package io.renren.modules.gengyun.dao;

import io.renren.modules.gengyun.entity.IndicatorEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.gengyun.entity.spare.CycleOfIndicator;
import io.renren.modules.gengyun.entity.spare.IndicatorShow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author krlin
 * @email 2032153705@qq.com
 * @date 2020-09-17 20:31:48
 */
@Mapper
public interface IndicatorDao extends BaseMapper<IndicatorEntity> {

    /**
     * 查询某个地块的各个指标值
     * @param cropRotationId
     * @return
     */
	List<IndicatorShow> indicatorShows(String cropRotationId);


    /**
     * 查询某个地块某一个指标的时间变化
     * @param cropRotationId
     * @param indicatorId
     * @param beginTime
     * @param endTime
     * @return
     */
	List<IndicatorShow> findByIndicatorIdAndCropRotationId(@Param("cropRotationId") String cropRotationId,
                                                           @Param("indicatorId") String indicatorId,
                                                           @Param("beginTime") Long beginTime,
                                                           @Param("endTime") Long endTime);

	List<CycleOfIndicator> getCycleOfIndicatorsByCropRotationId(@Param("cropRotationId") String cropRotationId,
																@Param("beginTime") Long beginTime,
																@Param("endTime") Long endTime);



	List<Map> getIndicatorsByTime(@Param("cropRotationId") String cropRotationId,
								  @Param("indicatorType") String indicatorType,
								  @Param("beginTime") Long beginTime,
								  @Param("endTime") Long endTime);

	List<String> getCropRotationId();

	List<Map<String,Object>> compareAllYearsDataByTargetName(@Param("cropRotationId") String cropRotationId,
																			  @Param("indicatorType") String indicatorType,
																			  @Param("beginTime") Long beginTime,
																				@Param("endTime") Long endTime);

//	List<Map<String,String>>

//	Map<String,List<IndicatorShow>> CompareAllYearsDataByTargetName(@Param("cropRotationId") String cropRotationId,
//															 @Param("indicatorType") String indicatorType,
//															 @Param("beginTime") Long beginTime,
//															 @Param("endTime") Long endTime);


}
